import { Vote } from "../../types/vote"

//Vote 是对象的约束  Vote[]: 数组里放的是对象
interface Istate {
    votelist: Vote[]
}
let initState = {
    votelist: []
}
export default (state = initState, action: any) => {
    console.log(action,'action')
    switch (action.type) {
        case "INIT_VOTELIST":
            return {votelist:[...action.list]}
        default:
            return state;
    }
}